#pragma once

class DBackground;
class DGame;
#include "../Utils/Singleton.h"

namespace GameStates {

class IState
{
public:
    virtual ~IState(void);

    virtual void enter(boost::shared_ptr<DGame> game) = 0;
    virtual void update(float dt, boost::shared_ptr<DGame> game) = 0;
    virtual void render(boost::shared_ptr<DGame> game) = 0;
    virtual void exit(boost::shared_ptr<DGame> game) = 0;
protected:
    IState(void);
};

///////////////// INTRO ////////////////////

class Intro : public IState
            , public DSingleton<Intro, IState>
{
public:
    void enter(boost::shared_ptr<DGame> game);
    void update(float dt, boost::shared_ptr<DGame> game);
    void render(boost::shared_ptr<DGame> game);
    void exit(boost::shared_ptr<DGame> game);
};

class Loading : public IState
              , public DSingleton<Loading, IState>
{
public:
    void enter(boost::shared_ptr<DGame> game);
    void update(float dt, boost::shared_ptr<DGame> game);
    void render(boost::shared_ptr<DGame> game);
    void exit(boost::shared_ptr<DGame> game);
private:
    boost::shared_ptr<DBackground> m_back;
    bool m_bLoading;

};

class Playing : public IState
              , public DSingleton<Playing, IState>
{
public:
    void enter(boost::shared_ptr<DGame> game);
    void update(float dt, boost::shared_ptr<DGame> game);
    void render(boost::shared_ptr<DGame> game);
    void exit(boost::shared_ptr<DGame> game);
};

} // namespace GameStates